local blaze = require "blaze"
local app = require "app"
local package = "club.threecard.pokerlib"

local lib = blaze.app.new({
    package,
    modules = 
    {
        ["core"] = "club.threecard.pokerlib.core"
    },
    on_splashscreen = blaze.noop,
    on_start = function()
        local lang = app.store.setting.state.lang
        local db = blaze.config.load(string.format("club/threecard/pokerlib/i18n/%s.lua", lang))
        app.i18n.add("club.threecard.pokerlib", db)

        local bank = app.audio.create_bank(app, "club.threecard.pokerlib", {
            actions = require("blaze.audio.actions"),
            soundbank = blaze.config.load("club/threecard/pokerlib/soundbank.lua")
        })
        app.audio.add_bank(bank)
    end,
    
    on_exited = function(self)
        app.audio.remove_bank("club.threecard.pokerlib")
        app.i18n.remove("club.threecard.pokerlib")
    end
})

return lib